package com.ruoyi.yunxin.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yunxin.mapper.VoiceNotifyMapper;
import com.ruoyi.yunxin.domain.VoiceNotify;
import com.ruoyi.yunxin.service.IVoiceNotifyService;

/**
 * 语音通知记录Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class VoiceNotifyServiceImpl implements IVoiceNotifyService {
    @Autowired
    private VoiceNotifyMapper voiceNotifyMapper;

    /**
     * 查询语音通知记录
     *
     * @param id 语音通知记录主键
     * @return 语音通知记录
     */
    @Override
    public VoiceNotify selectVoiceNotifyById(Long id) {
        return voiceNotifyMapper.selectVoiceNotifyById(id);
    }

    /**
     * 查询语音通知记录列表
     *
     * @param voiceNotify 语音通知记录
     * @return 语音通知记录
     */
    @Override
    public List<VoiceNotify> selectVoiceNotifyList(VoiceNotify voiceNotify) {
        return voiceNotifyMapper.selectVoiceNotifyList(voiceNotify);
    }

    /**
     * 新增语音通知记录
     *
     * @param voiceNotify 语音通知记录
     * @return 结果
     */
    @Override
    public int insertVoiceNotify(VoiceNotify voiceNotify) {
        voiceNotify.setCreateTime(DateUtils.getNowDate());
        return voiceNotifyMapper.insertVoiceNotify(voiceNotify);
    }

    /**
     * 修改语音通知记录
     *
     * @param voiceNotify 语音通知记录
     * @return 结果
     */
    @Override
    public int updateVoiceNotify(VoiceNotify voiceNotify) {
        voiceNotify.setUpdateTime(DateUtils.getNowDate());
        return voiceNotifyMapper.updateVoiceNotify(voiceNotify);
    }

    /**
     * 批量删除语音通知记录
     *
     * @param ids 需要删除的语音通知记录主键
     * @return 结果
     */
    @Override
    public int deleteVoiceNotifyByIds(Long[] ids) {
        return voiceNotifyMapper.deleteVoiceNotifyByIds(ids);
    }

    /**
     * 删除语音通知记录信息
     *
     * @param id 语音通知记录主键
     * @return 结果
     */
    @Override
    public int deleteVoiceNotifyById(Long id) {
        return voiceNotifyMapper.deleteVoiceNotifyById(id);
    }
}
